#include "ColorIdGenerator.hpp"

int     ColorIdGenerator::_colorShift = 1;
int     ColorIdGenerator::_r = 0;
int     ColorIdGenerator::_g = 0;
int     ColorIdGenerator::_b = 1;

ColorIdGenerator::ColorIdGenerator()
{
}

void    ColorIdGenerator::generate()
{
    _b += _colorShift;
    if (_b >= 256)
    {
        _b = 0;
        _g += _colorShift;
        if (_g >= 256)
        {
            _g = 0;
            _r += _colorShift;
        }
    }
}

int     ColorIdGenerator::getR() const
{
    return _r;
}

int     ColorIdGenerator::getG() const
{
    return _g;
}

int     ColorIdGenerator::getB() const
{
    return _b;
}
